cmake_minimum_required(VERSION 3.17)
project(goj_judge)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS -Wall)
include_directories(/usr/local/mysql/include/mysql)
include_directories(/usr/include/mysql)
link_directories(/usr/local/mysql/lib/mysql)
link_directories(/usr/lib/mysql)
link_directories(/usr/lib64/mysql)
link_libraries(mysqlclient)

# Find all main*.cpp files and store in list mains
file(GLOB_RECURSE mains RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*.cc")
foreach(mainfile IN LISTS mains)
    # Get file name without directory
    get_filename_component(mainname ${mainfile} NAME_WE)
    add_executable(${mainname} ${mainfile} test.cc)
endforeach()
